Next.js Cache
Progressive ISR at the component level
Faster refreshes without network requests
Faster redeploys of code changes to static pages
完全に静的なページについては、従来のISRと同じ挙動
静的と動的が混在するページの挙動が変わる
code:ts
// app/page.jsx
export default async function Page() {
// Cached until manually invalidated
fetch(https://...),
// Refetched on every request
fetch(https://..., { cache: 'no-store' }),
// Cached with a lifetime of 10 seconds
fetch(https://..., { next: { revalidate: 10 } }),
]);
return <div>...</div>;
}
ISRからさらに、
以前に静的に生成された特定のrouteを、プログラム的に無効にする
ページ単位ではなく、Component単位でISRする
deployを跨いでcacheを再利用したい
Vercelと併用したときだけ?
Edge Serverでcacheが残るらしい
ユーザーのパーソナライゼーションなど、ページの一部に動的なコードが必要な場合の対応
以前まではSSRでやってたこともISRでできるってこと #?? betaで入った
4種類